package a02_链表;

/**
 * <p>
 * a04_反转链表复习6
 * </p>
 *
 * @author flyduck
 * @since 2025/4/10
 */
public class a04_反转链表复习6 {
    public ListNode reverseList(ListNode head) {
        ListNode prev = null;
        ListNode curr = head;

        while (curr != null){
            ListNode next = curr.next;

            curr.next = prev;

            prev = curr;
            curr = next;
        }

        return prev;
    }
}
